package com.ds.config;

import com.ds.pojo.Student;
import com.ds.pojo.User;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Scope;

/**
 * @program: Spring-Study
 * @description:
 * @author: Dawson.Zhang
 * @create: 2020-04-04
 **/
@Configuration
//<beans>
//@ComponentScan("com.ds.pojo")
//<context:component-scan base-package="com.ds.pojo"/>
public class BeansConfig {

    //注册一个bean，就相当于我们之前写的一个  <bean>标签
    //这个方法的名字，就相当于bean标签中的id属性
    //这个方法的返回值，就相当于bean标签中的class属性
    //@Scope(value = "prototype")
    @Bean
    public User getUser() {
        return new User();
    }
    @Bean
    public Student getStudent(){
        return new Student();
    }
}
